Advertisement
Guest User

Untitled

a guest
Dec 21st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. (adapted for ngcgui from Chris Radek routine: P-hole.ngc)
  2. (info: Probe hole, start from approx x,y center)
  3.  
  4. o<p-hole> sub
  5. #<maxradius> = #1 (=4)
  6. #<zsafe> = #2 (=.1)
  7. #<feednorm> = #3 (=5)
  8. #<feedslow> = #4 (=0.05)
  9. #<probediam> = #5 (=.07874 probe diam)
  10. #<in_or_mm> = #6 (=21 in:20, mm:21)
  11. #<offset> = #7 (=0.025)
  12. #<finaldist> = #8 (=0.10)
  13.  
  14. G#<in_or_mm> ; inch or mm
  15. F#<feednorm>
  16.  
  17. G90
  18. #<xstart>=#5420
  19. #<ystart>=#5421
  20. G91 G38.3 Z0.001 ; establish initial xcenter,ycenter with noerror probe move
  21.  
  22. ;M110 ; clear axis ui notifications
  23. ; bug in interp_convert.cc prevents mulitple named params with debug,
  24. ; (debug, start x,y =#<xstart> #<ystart)
  25. ;(debug, start x,y =#5420,#5421)
  26. (debug,Probe four times +x,-x,+y,-y at feednorm)
  27. ;(debug,Then probe again at feedslow)
  28. ;(debug,Press RESUME to begin)
  29. M0
  30. #<xcenter>=#5061
  31. #<ycenter>=#5062
  32.  
  33. G91 G38.2 X#<maxradius> ; incremental +x probe
  34. #<xplus>=#5061
  35. G90 G0 X#<xcenter> ; absolute move to xcenter
  36. G91 G38.2 X[0-#<maxradius>] ; incremental -x probe
  37. #<xminus>=#5061
  38. #<xcenter>=[[#<xplus>+#<xminus>]/2] ; new xcenter
  39. G90 G0 X#<xcenter> ; absolute move to xcenter
  40.  
  41. G91 G38.2 Y#<maxradius>
  42. #<yplus>=#5062
  43. G90 G0 Y#<ycenter>
  44. G91 G38.2 Y[0-#<maxradius>]
  45. #<yminus>=#5062
  46. #<ycenter>=[[#<yplus>+#<yminus>]/2]
  47. G90 G0 Y#<ycenter>
  48.  
  49. F#<feedslow>
  50.  
  51. G90 G0 X[#<xplus>-#<offset>]
  52. G91 G38.2 X#<finaldist>
  53. #<xplus>=#5061
  54. G90 G0 X[#<xminus>+#<offset>]
  55. G91 G38.2 X-#<finaldist>
  56. #<xminus>=#5061
  57. #<xcenter>=[[#<xplus>+#<xminus>]/2]
  58. G90 G0 X#<xcenter>
  59.  
  60. G90 G0 Y[#<yplus>-#<offset>]
  61. G91 G38.2 Y#<finaldist>
  62. #<yplus>=#5062
  63. G90 G0 Y[#<yminus>+#<offset>]
  64. G91 G38.2 Y-#<finaldist>
  65. #<yminus>=#5062
  66. #<ycenter>=[[#<yplus>+#<yminus>]/2]
  67. G90 G0 Y#<ycenter>
  68.  
  69. #<xdia> = [#<xplus>-#<xminus>+#<probediam>]
  70. #<ydia> = [#<yplus>-#<yminus>+#<probediam>]
  71. #<dia> = [[#<xdia>+#<ydia>]/2]
  72. #<angle> = [atan[#<ycenter>]/[#<xcenter>]]
  73. #<dist> = [sqrt[[#<xcenter>*#<xcenter>]+[#<ycenter>*#<ycenter>]]]
  74.  
  75. G0 Z#<zsafe>
  76. (debug,Xdia=#<xdia> Ydia=#<ydia> Dia=#<dia> Ang=#<angle> Dist=#<dist>)
  77. (debug,Xcenter=#<xcenter> Ycenter=#<ycenter> Dia=#<dia>)
  78.  
  79. o<p-hole> endsub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement